package
{
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	
	import fleditor.common.DialogBoxManager;
	import fleditor.controller.FlEditorController;
	import fleditor.core.loader.LoaderFactory;
	import fleditor.model.FlEditorModel;
	import fleditor.utils.DebugStats;
	import fleditor.view.MainView;
	
	/**
	 * 默认窗口界面大小1000*600，25 Frame
	 */	
	[SWF(width = "1000",height = "600",frameRate = "25")]
	/**
	 * FlEditor注入程序入口
	 * FlEditor是一个针对于2.5D的Flash地图编辑器
	 */
	public class FlEditor extends Sprite
	{
		/**
		 *全局Model类(FlEditModel)
		 */		
		private var _model:FlEditorModel;
		
		/**
		 * 全局控制器(FlEditorController)
		 */		
		private var _controller:FlEditorController;
		
		public function FlEditor()
		{
			stage.align = StageAlign.TOP_LEFT;
			stage.scaleMode = StageScaleMode.NO_SCALE;
			LoaderFactory.Instance.register();
			DialogBoxManager.Instance.register(stage);
			
			//全局Model类(FlEditModel)初始创建
			_model=new FlEditorModel();
			
			//全局全局控制器(FlEditorController)初始创建
			_controller=new FlEditorController(_model);
			
			//创建主界面视图并加载
			addChild(new MainView(stage, _controller, _model));
			
			var fpsContainer:DebugStats = new DebugStats();
			addChild(fpsContainer);
		}
	}
}